package com.skyworth.web.admin.table.service;

import com.google.gson.JsonObject;
import com.skyworth.web.admin.table.form.TableForm;
import com.skyworth.web.admin.table.model.TableModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Created by cody on 2016/8/11.
 */
public interface ITableService {

    int IDLE = 0; //空闲
    int USING = 1; //使用中

    Iterable<TableModel> queryByManagerId(long id);
    /**
     * 获取商家的台桌
     * @param id
     * @return
     */
    Iterable<TableModel> queryByStoreId(Long id);

    /**
     * 添加或者修改
     * @param item
     * @return
     */
    TableModel saveOrUpdate(TableModel item);


    public TableModel addTable(TableForm tableForm);
    public TableModel updateTable(TableForm storeForm);
    public boolean existTable(String name);
    public void removeTable(long id);
    public TableModel findTable(long id);

    public List<TableModel> tableList(JsonObject params);
    public Page<TableModel> tablePage(JsonObject params, Pageable pageable);

    public void updateTableState(long tableId);

    boolean existTable(String name, long id);

    boolean existTableByStore(String name, long store_id);
}
